<template>
  <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
    <el-tab-pane label="通用配置" name="basic">
      <basicConfigSet :rpc-mer-id="rpcMerId" :config-name="configName" :form-view="editView" :is-load="activeName == 'basic' && isLoad" />
    </el-tab-pane>
    <el-tab-pane label="独立配置" name="alone">
      <configList :rpc-mer-id="rpcMerId" :config-name="configName" :title="'重复请求配置'" :edit-view="editView" :add-view="addView" :is-load="activeName == 'alone' && isLoad" />
    </el-tab-pane>
  </el-tabs>
</template>
<script>
import basicConfigSet from '../../config/basicConfigSet'
import configList from '../../config/sysConfig'
export default {
  components: {
    basicConfigSet,
    configList
  },
  props: {
    rpcMerId: {
      type: Number,
      default: 0
    },
    isLoad: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      configName: 'gateway:idempotent',
      addView: 'IdempotentFrom',
      editView: 'IdempotentFrom',
      activeName: 'basic'
    }
  },
  methods: {
    handleClick(e) {
      this.activeName = e.name
    }
  }
}
</script>
